module.exports = {
    apiExport: function (list, cnt) {
        return {
            "error_code": 0,
            "data": {
                list: list,
                cnt: cnt
            }
        };
    },
    apiExport2: function (data) {
        return {
            "error_code": 0,
            "data": data
        };
    },
    apiError: function (err) {
        return {
            "error_code": 20000,
            "error_msg": err
        };
    },

    isset: function (obj, attr = []) {
        for (let i in attr) {
            if (!(attr[i] in obj)) {
                return false
            }
        }
        return true;
    },
};
